<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title data-lang="title">emokili - Request Password Reset</title>
	<meta name="description" content="Introducing the emokili Cloud Frame, the unique WiFi digital photo frame that manages all your social media photos through one personalized cloud account!">
    <link rel="shortcut icon" href="../static/images/b2c-login/b2c-login/b2c-login/b2c-login/favicon.ico">
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script src="https://www.recaptcha.net/recaptcha/api.js" async defer></script>
    <script src="https://www.recaptcha.net/recaptcha/api.js?render=6Lc5vbAUAAAAAGplrgZ43Q9VL00sbuo1o6FecCIv"></script>
        <style>
            html{width:100%;height:100%}body,html{padding:0;margin:0;font-size:16.5px}body,html,input{font-family:avenirlight,'Avenir W01',Avenir,Helvetica,Arial,sans-serif}*{box-sizing:border-box}.flex-1{-webkit-box-flex:1;-moz-box-flex:1;width:20%;-webkit-flex:1;-ms-flex:1;flex:1}.flex{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex}.container{padding: 0 15px;width:100%;max-width:480px;margin:0 auto}.input-group{overflow:hidden}.input-group.padding{padding:8px}.input-group input{outline:0}.input-group input,button{font-size:1em;border:none}.input-group.border{border:solid 1px silver;border-radius:5px}.input-group.focus{border:solid 1px #000}.input-group.red{border:solid 1px red}.btn{border-radius:5px}.full-height{min-height:70vh}.btn-full{width:100%}.bg-blue{background:#479ade}.bg-white{background:#fff}.bg-trasparent{background:0 0}.color-blue{color:#479ade}.color-white{color:#fff}a{text-decoration:none!important}.block{display:block}.inline-block{display:inline-block}.padding-y-20{padding-top:20px;padding-bottom:20px}.padding-x-20{padding-left:20px;padding-right:20px}.padding-y-8{padding-top:8px;padding-bottom:8px}.padding-20{padding:20px}.padding-top-20{padding-top:20px}.padding-14{padding:14px}.cursor-pointer{cursor:pointer}.margin-right-20{margin-right:20px}.margin-x-20{margin-left:20px;margin-right:20px}.margin-y-40{margin-top:40px;margin-bottom:40px}.margin-top-20{margin-top:20px}.margin-left-20{margin-left:20px}.margin-right-20{margin-right:20px}.margin-bottom-40{margin-bottom:40px}.margin-top-40{margin-top:40px}.no-margin-top{margin-top:0}.no-margin-bottom{margin-bottom:0}.header{background:#f8f8f8}.text-center{text-align:center}.header img{height:50px;max-width:200px}.font-normal{font-weight:400}body{background-image:url(../static/images/b2c-login/nixPattern.jpg);background-repeat:repeat-x;background-size:100% auto;background-position:left bottom; background-attachment: fixed;}.items-center{align-items:center}.store-images img{height:50px; width: 167px;}.icon{height:25px}
            .color-red{ color: red}
            ul, li{ margin: 0px; padding: 0px; }
            li{ list-style: none;}
            .input-group{ padding: 1px;}
            .input-group.border.error{
                border: solid 1px red;
            }
            .input-group.error{
                position: relative;
                overflow: visible;
            }
            .input-group.error input{ 
                border-radius: 5px;
            }
    
            .margin-y-20 {
                margin-top: 20px; margin-bottom: 20px;
            }
            .input-error{ display: none }
            .input-group.error .input-error{
                top: 106%;
                left: 0px;
                position: absolute;
                color: red;
                display: block;
                width: 100%;
                max-width: 100%;
                line-height: 100%;
            }
            .input-error span{
                font-size: 90%;
            }
    
            .auth-modal-signup-1, .auth-modal-signup-2, .auth-modal-signup-3, .app-section {
                display: none;
            }
            .signup-1  .auth-modal-signup-1, .signup-1 .app-section{ display: block; }
            .signup-2  .auth-modal-signup-2{ display: block; }
            .signup-3  .auth-modal-signup-3{ display: block; }
            .hide { display: none;}
            .ui-autocomplete {
                max-height: 400px;
                overflow-y: scroll;
    
            }
            .ui-autocomplete .ui-menu-item {
                padding: 20px;
            }
    
      .form-radio
    {
         -webkit-appearance: none;
         -moz-appearance: none;
         appearance: none;
         display: inline-block;
         position: relative;
         background-color: #f1f1f1;
         color: #666;
         top: 8px;
         height: 20px;
         width: 20px;
         border: 0;
         border-radius: 50px;
         cursor: pointer;     
         margin-right: 3px;
         outline: none;
    }
    .form-radio:checked::before
    {
         position: absolute;
         font: 13px/1 'Open Sans', sans-serif;
         left: 6px;
         top: 3px;
         content: '\02143';
         transform: rotate(40deg);
    }
    .form-radio:after
    {
        content: ' ';
        position: absolute;
        top: -2px;
        left: -2px;
        border-radius: 50px;
        height: 20px;
        width: 20px;
        border: solid 2px grey;
    }
    .form-radio:hover
    {
         background-color: #f7f7f7;
    }
    .form-radio:checked
    {
         background-color: #f1f1f1;
    }
    label
    {
         font: 15px/1.7 'Open Sans', sans-serif;
         color: #333;
         -webkit-font-smoothing: antialiased;
         -moz-osx-font-smoothing: grayscale;
         cursor: pointer;
    } 
        </style>
    
        <script type="text/javascript">
             var env = 'prod';
            var apiUrl = 'https://api.emokili.com'; // 'http://api.devm.emokili.com'
            var wwwUrl = 'https://www.emokili.com';
            var apiV3Url = 'https://api.emokili.com/v3'; // 'http://api.devm.emokili.com/v3'
            var usernameDomainPart = 'myemokili.com';
        </script>
    
    <script>
        !function(e){var n=!1;if("function"==typeof define&&define.amd&&(define(e),n=!0),"object"==typeof exports&&(module.exports=e(),n=!0),!n){var o=window.Cookies,t=window.Cookies=e();t.noConflict=function(){return window.Cookies=o,t}}}(function(){function g(){for(var e=0,n={};e<arguments.length;e++){var o=arguments[e];for(var t in o)n[t]=o[t]}return n}return function e(l){function C(e,n,o){var t;if("undefined"!=typeof document){if(1<arguments.length){if("number"==typeof(o=g({path:"/"},C.defaults,o)).expires){var r=new Date;r.setMilliseconds(r.getMilliseconds()+864e5*o.expires),o.expires=r}o.expires=o.expires?o.expires.toUTCString():"";try{t=JSON.stringify(n),/^[\{\[]/.test(t)&&(n=t)}catch(e){}n=l.write?l.write(n,e):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=(e=(e=encodeURIComponent(String(e))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var i="";for(var c in o)o[c]&&(i+="; "+c,!0!==o[c]&&(i+="="+o[c]));return document.cookie=e+"="+n+i}e||(t={});for(var a=document.cookie?document.cookie.split("; "):[],s=/(%[0-9A-Z]{2})+/g,f=0;f<a.length;f++){var p=a[f].split("="),d=p.slice(1).join("=");this.json||'"'!==d.charAt(0)||(d=d.slice(1,-1));try{var u=p[0].replace(s,decodeURIComponent);if(d=l.read?l.read(d,u):l(d,u)||d.replace(s,decodeURIComponent),this.json)try{d=JSON.parse(d)}catch(e){}if(e===u){t=d;break}e||(t[u]=d)}catch(e){}}return t}}return(C.set=C).get=function(e){return C.call(C,e)},C.getJSON=function(){return C.apply({json:!0},[].slice.call(arguments))},C.defaults={},C.remove=function(e,n){C(e,"",g(n,{expires:-1}))},C.withConverter=e,C}(function(){})});
    </script>
    <script>
            let token;
            grecaptcha.ready(function () {
                getToken()
                        .then(() => {
                            getCaptcha()
                        })
            });

            function getToken() {
                return grecaptcha.execute('6Lc5vbAUAAAAAGplrgZ43Q9VL00sbuo1o6FecCIv', { action: 'forgetPassword' }).then(function (t) {
                    token = t;
                    $('input[name="token"]').val(token)
                    return t;
                });
            }

            function getCaptcha() {
                axios.get('https://api.emokili.com/v3/captcha', { params: { token } })
                        .then(({ data }) => {
                            const $c = document.getElementById('g-recaptcha');
                            if (data) {
                                $c.remove();
                            } else {
                                $c.style.display = 'flex'
                            }
                        })
                        .catch((err) => console.error(err));
            }
        var USER_LANGUAGE = {
            'en_US' : {
                'title' :  'Request Password Reset',
                'note': '"Enter the address of your day-to-day email account, not the one ending in “@myemokili.com”, into the box below to request a password reset. "',
                'email_adress':  'Your Email Address',
                'reset': 'Reset',
                'request_sent': 'Password Reset Request Sent',
                'check_inbox': 'Please check your inbox',
                'download_app' :  'Download Emokili Mobile App',
                'all_rights' : '© 2020 Emokili. All rights reserved.',
                'app_store' :  './images/b2c-login/app-store-2x.png',
                'google_play' : './images/b2c-login/play-store-2x.png'
            },
            'de_DE' : {
                'title' :  'Passwort zurücksetzen',
                'note': 'Geben Sie Ihre alltäglichen Email Adresse an (nicht Ihre @myemokili.com Adresse) in dem Feld unten um Ihr Passwort zurückzusetzen.',
                'email_adress':  'Ihre E-Mail-Adresse',
                'reset': 'Zurücksetzen',
                'request_sent': 'Passwortrücksetzung Anfrage gesendet.',
                'check_inbox': 'Sie haben eine E-Mail von uns bekommen.',
                'download_app' :  'Emokili Mobile App herunterladen',
                'all_rights' : '© 2020 Emokili. Alle Rechte. Reserviert.',
                'app_store' :  './images/b2c-login/app-store-de.svg',
                'google_play' : './images/b2c-login/play-store-de.svg'
            },
			'ja_JP': {
				"title": "パスワードのリセット要求",
				"note": "「@myemokili.com」で終わるものでなく、普段使っているメールアドレスを下記のボックスに入力し、パスワードのリセットを要求します。 ",
				"email_adress": "電子メールアドレス",
				"reset": "リセット",
				"request_sent": "パスワードのリセット要求が送信されました",
				"check_inbox": "メールボックスを確認してください",
				"download_app": "Emokiliモバイルアプリダウンロード",
				"all_rights": "© 2020 Emokili.無断複写・複製・転載を禁ず。",
				'app_store' :  './images/b2c-login/app-store-jp.svg',
				'google_play' : './images/b2c-login/play-store-jp.png'
			},
			'fr_FR' : {
				"title": "Demander la réinitialisation de mon mot de passe",
				"note": "Saisissez votre adresse e-mail habituelle (pas celle qui se termine par « @myemokili.com ») dans le champ ci-dessous pour demander la réinitialisation de votre mot de passe. ",
				"email_adress": "Votre adresse e-mail",
				"reset": "Réinitialiser",
				"request_sent": "Demande de réinitialisation de mot de passe envoyée",
				"check_inbox": "Veuillez consulter votre boîte de réception.",
				"download_app": "Télécharger l'application mobile Emokili",
				'all_rights' : '© 2020 Emokili. Tous droits réservés.',
				'app_store' :  './images/b2c-login/app-store-fr.svg',
				'google_play' : './images/b2c-login/play-store-fr.png',
			},
        }
    </script>

    <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
</head>
<body>

<div class="header padding-y-20 text-center margin-bottom-40">
    <img src="../static/images/b2c-login/b2c-login/b2c-login/b2c-login/emokili Logo Horizontal Lockup RGB v3 all.svg" alt="">
	<style>
		#lang-picker {
			display: inline-block;
			position: absolute;
			right: 10vw;
			width: 150px;
			height: 50px;
			cursor: pointer;
			opacity: 0;
			transition: opacity 0.3s 1s ease-out;
		}
		#lang-picker-btn {
			display: flex;
			justify-content: center;
			align-items: center;
			height: 50px;
			color: #555;
		}
		#lang-picker-btn span {
			margin: 0 8px;
		}
		#lang-picker:hover #lang-picker-dropdown {
			 display: flex;
		}
		#lang-picker-dropdown {
			display: none;
			justify-content: center;
			align-items: center;
			flex-wrap: wrap;
			width: 150px;
			border: 1px solid #ddd;
			border-radius: 5px;
			background: white;
			box-shadow: 0px 6px 8px -4px #ddd;
		}
		#lang-picker-dropdown a {
			width: 150px;
			padding: 20px;
			border-bottom: 1px solid #ddd;
			color: #bbb;
			transition: color 0.3s ease-out;
		}
		#lang-picker-dropdown a:hover {
			color: #000;
		}
		@media all and (max-width: 600px) {
			#lang-picker {
				display: block;
				position: relative;
				right: unset;
				margin: auto;
			}
		}
	</style>
	<div id="lang-picker">
		<div id="lang-picker-btn">
			<ion-icon style="font-size: 30px;" name="globe-outline"></ion-icon>
			<span id="lang-picker-btn-value"></span>
			<ion-icon name="chevron-down-outline"></ion-icon>
		</div>
		<div id="lang-picker-dropdown">
			<a onclick="changeLang('en_US')">English</a>
			<a onclick="changeLang('de_DE')">Deutsch</a>
			<a onclick="changeLang('fr_FR')">Français</a>
			<a onclick="changeLang('ja_JP')">日本語</a>
		</div>
	</div>
	<script type="module" src="https://unpkg.com/ionicons@5.0.0/dist/ionicons/ionicons.esm.js"></script>
	<script nomodule="" src="https://unpkg.com/ionicons@5.0.0/dist/ionicons/ionicons.js"></script>
	<script>
		function getSystemFeature(){
		  if (env === 'dev'){
		    env = 'rnd'
	      }
			return fetch(`https://api.${env === 'prod'?'': env + '.'}emokili.com/v3/system-features`).then(data => data.json()).then(({ features }) => {
				return features.map(x => x.name)
			}).catch(e => {
				return []
			})
		}
		function getCookieValue(a) {
			var b = document.cookie.match('(^|[^;]+)\\s*' + a + '\\s*=\\s*([^;]+)');
			return b ? b.pop() : '';
		}
		function init(){
			var lang = getCookieValue('lang')
			console.log(lang)
			getSystemFeature()
			.then(features => {
				var $lang = document.getElementById('lang-picker')
				var $value = document.getElementById('lang-picker-btn-value')
	
				if (lang === 'de_DE') {
					$value.innerText = 'Deutsch'
				} else if (lang === 'ja_JP') {
					$value.innerText = '日本語'
				} else if (lang === 'fr_FR'){
					$value.innerText = 'Français'
				} else {
					$value.innerText = 'English'
				}
				$lang.style.opacity = 1;
	
				var langCook = getCookieValue('lang')
				fetch('https://ipapi.co/country/').then(data => data.text()).then(r => {
					console.info(r)
					if (!langCook && !window.location.search.includes('lang=')) {
						if (r === 'DE') {
							changeLang('de_DE')
						} else if (r === 'JP') {
							changeLang('ja_JP')
						} else if (r === 'FR') {
							changeLang('fr_FR')
						} else {
	                        changeLang('en_US')
	                    }
					}
					if (langCook && !['de_DE', 'ja_JP', 'fr_FR', 'en_US'].includes(langCook)) {
	                    changeLang('en_US')
	                }
					try {
						$('.ui-autocomplete-input').val($('option[data-alternative-spellings~="' + r + '"]').val())
					} catch (err) {
						console.info('no country input')
					}
				}).catch(() => console.info('cannot locate user'))
			})
		}
	
		document.addEventListener("DOMContentLoaded", function() {
			init();
		});
		function replaceUrlParam(url, paramName, paramValue) {
			if (paramValue == null) {
				paramValue = '';
			}
			var pattern = new RegExp('\\b('+paramName+'=).*?(&|#|$)');
			if (url.search(pattern)>=0) {
				return url.replace(pattern,'$1' + paramValue + '$2');
			}
			url = url.replace(/[?#]$/,'');
			return url + (url.indexOf('?')>0 ? '&' : '?') + paramName + '=' + paramValue;
		}
	
		function changeLang(lang){
			window.location.href = replaceUrlParam(window.location.href, 'lang', lang)
		}
	</script>
</div>

	<div class="subsequent-page full-height">
            <div class="container text-center padding-top-20">
                <div id="step-0" class="forget-pwd row justify-content-center no-margin ">
                    <section id="request-reset" class="col-11 col-sm-8 col-md-6 column">
                        <header>
                            <h1 class="font-normal text-center margin-y-40 no-margin-bottom text-center" data-lang="title">Request Password Reset</h1>
                        </header>
                        <div class="info">
                            <p class="no-margin-top margin-bottom-40" data-lang="note" >Enter the address of your day-to-day email account, not the one ending in &quot;@myemokili.com&quot;, into the box below to request a password reset.</p>
                        </div>
                        <form id="forget-form" class="" action="" method="POST">
                            <div class="input-group email-group items-center focus-input border flex bg-white margin-bottom-40">
                                <label for="email" class="margin-x-20" data-lang="email_adress">Your Email Address</label>
                                <input type="text" name="email" id="email" class="padding-y-20 flex-1" data-lang-placeholder="email_adress"/>
                            </div>
                            <input type="hidden" name="token"/>
                            <div class="g-recaptcha" style="display: none; justify-content: center;" id="g-recaptcha" data-sitekey="6Lfy_7YUAAAAAP6bgXHgPJ7eCwXkMNWlSN7PzBYE"></div>
                            <div class="login-error-container color-red text-center margin-y-20"></div>
                            <div>
                                <button class="btn bg-blue btn-full color-white padding-20 block submit cursor-pointer" type="Submit" data-lang="reset"> reset</button>
                            </div>
                        </form>
                    </section>

                    <section id="request-sent" class="small-offset-3 small-6 column left hide">
                        <header>
                            <h2 class="font-normal text-center margin-y-40 no-margin-bottom text-center" data-lang="request_sent">Password Reset Request Sent</h2>
                        </header>
                        <div class="info">
                            <p class="no-margin-top margin-bottom-40" data-lang="check_inbox">Please check your inbox. </p>
                        </div>
                    </section>
                </div>
            </div>
        </div>
        <div class="text-center margin-top-40 padding-y-20" data-lang="all_rights">  </div>
        <script>
          Array.from||(Array.from=function(){function h(r){return"function"==typeof r||"[object Function]"===n.call(r)}function l(r){var n=function(r){var n=Number(r);return isNaN(n)?0:0!==n&&isFinite(n)?(0<n?1:-1)*Math.floor(Math.abs(n)):n}(r);return Math.min(Math.max(n,0),t)}var n=Object.prototype.toString,t=Math.pow(2,53)-1;return function(r,n,t){var e=Object(r);if(null==r)throw new TypeError("Array.from requires an array-like object - not null or undefined");var o,a=1<arguments.length?n:void 0;if(void 0!==a){if(!h(a))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(o=t)}for(var i,u=l(e.length),f=h(this)?Object(new this(u)):new Array(u),c=0;c<u;)i=e[c],f[c]=a?void 0===o?a(i,c):a.call(o,i,c):i,c+=1;return f.length=u,f}}());
        </script>
        
        <script>
          var lang
        
        
            function getParameterByName(nameInput, href) {
              const url = (href) ? href : window.location.href;
              const name = nameInput.replace(/[\[\]]/g, '\\$&');
              const regex = new RegExp('[?&]'+name+'(=([^&#]*)|&|#|$)');
              const results = regex.exec(url);
              if (!results) { return null; }
              if (!results[2]) { return ''; }
              return decodeURIComponent(results[2].replace(/\+/g, ' '));
            }
            function translatePage () {
            var languageElements = Array.from(document.querySelectorAll('[data-lang], [data-lang-placeholder], [data-lang-src], [data-lang-title], [data-lang-href]'));
            languageElements.forEach(function(element) {
              var key = element.dataset.lang;
              if (key) element.innerHTML = USER_LANGUAGE[lang][key];
              var placeholder = element.dataset.langPlaceholder;
              if (placeholder) element.setAttribute('placeholder', USER_LANGUAGE[lang][placeholder]) ;
              var url = element.dataset.langHref;
              if (url) element.href = USER_LANGUAGE[lang][url];
              var src = element.dataset.langSrc;
              if (src) element.src = USER_LANGUAGE[lang][src];
              var title = element.dataset.langTitle;
              if (title) element.title = USER_LANGUAGE[lang][title];
            });
          }
            activeLang = (Cookies.get('lang')) ? Cookies.get('lang') : 'en_US';
            lang = (getParameterByName('lang')) ? getParameterByName('lang') : activeLang;
            lang = (lang === 'en_US' || lang === 'de_DE' || lang === 'ja_JP' || lang === 'fr_FR') ? lang : activeLang;
            Cookies.set('lang', lang);
        
        
        
        
            (function(){
                'use strict';
            var origin,  languageElements, pair, activeLang, inputs, password_inputs;
        
            origin = getParameterByName('origin');
            var country = getParameterByName('country');
            var oldCountry = Cookies.get('country');
            if(country && country == 'us' || country == 'uk' || country == 'de' ) {
              Cookies.set('country', country)
            } else if(oldCountry) {
              country = Cookies.get('country')
            } else { country = 'us' }
            pair = getParameterByName('pair');
        
        
            if(origin) {Cookies.set('origin', origin);}
            if(pair) {
              document.getElementById('signup_pair_yes').checked=true;
            }
        
            translatePage();
        
            inputs = Array.from(document.getElementsByClassName('focus-input'));
            password_inputs = Array.from(document.getElementsByClassName('password-toggle'));
        
            inputs.forEach(function(element) {
              var input = element.querySelector('input')
              element.addEventListener('click', function() {
                input.focus();
                element.classList.add('focus')
              });
              if(input) {
                input.addEventListener('blur', function() {
                    element.classList.remove('focus')
                  })
              }
            });
        
            password_inputs.forEach(function(element) {
                var passwordInput = element.querySelector('.password_input');
                var password = element.querySelector('.show_password');
                password.addEventListener('click', function() {
                    passwordInput.type = (passwordInput.type === 'password') ? 'text' : 'password';
                  });
            });
        
            })();
        </script>
        <script>
        var NIXValidator, language;
        
        NIXValidator = {};
        
        language = (Cookies.get('lang')) ? Cookies.get('lang') : 'en_US';
        
        
        var USER_LANGUAGE = {
            'en_US' : {
        		'reset': 'Reset',
                'please_enter_your' :  'Please enter your ',
                'please_enter_your_email' : 'Please enter your email address',
                'creating_account': 'Creating account ...',
                'create_account_btn' : 'Create Account',
                'loggin_in' :  'Logging you in...',
                'login' : 'Login',
                'email_dont_exist': 'This email does not exist',
                'username_dont_exist': 'This username does not exist',
                'valid_email': 'Please enter a valid email address',
                'check_credentials': 'Please use your username and password',
                'you_must_agree' : 'Please agree to the Privacy Policy and Terms of Service',
                'first_name' : 'First Name',
                'last_name' : 'Last Name',
                'max30' : 'Your #[field] is too long (Max. 30 characters)',
                'noURL' : 'Your #[field] cannot contain URL',
                'noSymbols': 'Your #[field] cannot contain symbols: &/:$%<>',
                'email_used' : 'This email is already used',
                'username_taken' : 'This username is already taken',
                'enter_username' : 'Please enter a username',
                'enter_valid_username': 'Please enter a valid username (Min. 4 characters, a-z A-Z 0-9)',
                'username_too_long': 'Your username is too long (Max. 240 characters)',
                'short_password': 'Password is too short (Min. 6 characters)',
                'no_match': 'Passwords do not match',
                'enter_password': 'Please enter a password',
                'unexpected_error': 'Sorry, there was an unexpected error. Please try again.',
                'invalid_token': 'Invalid verification token.',
                'processing': 'Processing...',
                'user_not_found' : 'User not found',
        		'login_error_max_rate_1': 'You are allowed a maximum ',
        		'login_error_max_rate_2': ' request rate, please try again later.',
        		'login_too_many_attempts_1': 'Too many log in attempts. Please Reset Password or retry in ',
        		'login_too_many_attempts_2': ' minutes.'
            },
            'de_DE' : {
        		'reset': 'Zurücksetzen',
                'please_enter_your' :  'Bitte geben Sie ihren ',
                'please_enter_your_email' : 'Bitte geben Sie Ihre Email-Adresse an',
                'creating_account': 'Erstellen von Ihrem Konto ...',
                'create_account_btn' : 'Konto erstellen',
                'loggin_in' :  'Einloggen...',
                'login' : 'Anmelden',
                'email_dont_exist': 'Diese E-Mail existiert nicht',
                'username_dont_exist': 'Dieser Benutzername existiert nicht',
                'valid_email': 'Bitte geben Sie eine gültige E-Mail-Adresse ein',
                'check_credentials': 'Bitte benutzen Sie Ihren Benutzernamen und Ihr Passwort',
                'you_must_agree' : 'Bitte stimmen Sie den Datenschutzbestimmungen und Nutzungsbedingungen zu',
                'first_name' : 'Vorname',
                'last_name' : 'Nachname',
                'max30' : 'Dein #[field] ist zu lang (max. 30 Zeichen)',
                'noURL' : 'Ihr #[field] darf keine URL enthalten',
                'noSymbols': 'Ihr #[field] darf keine Symbole enthalten: & /: $% <>',
                'email_used' : 'Diese E-Mail wird bereits verwendet',
                'username_taken' : 'Dieser Benutzername ist bereits vergeben',
                'enter_username' : 'Bitte geben Sie einen Benutzernamen ein',
                'enter_valid_username': 'Bitte geben Sie einen gültigen Benutzername an (Minimum 4 Zeichen, a-z A-Z 0-9)',
                'username_too_long': 'Ihr Benutzername ist zu lang (max. 240 Zeichen)',
                'short_password': 'Das Passwort ist zu kurz (Minimum 6 Zeichen)',
                'no_match': 'Passwörter stimmen nicht überein',
                'enter_password': 'Bitte Passwort eingeben',
                'unexpected_error': 'Entschuldigung, es ist ein unerwarteter Fehler aufgetreten. Bitte versuche es erneut.',
                'invalid_token': 'Ungültiges Bestätigungstoken.',
                'processing': 'In Bearbeitung ...',
                'user_not_found' : 'Benutzer wurde nicht gefunden',
        		'login_error_max_rate_1': 'Sie dürfen maximal ',
        		'login_error_max_rate_2': ' Anfragen stellen. Bitte versuchen Sie es später erneut.',
        		'login_too_many_attempts_1': 'Zu viele Anmeldeversuche. Bitte setzen Sie das Passwort zurück oder versuchen Sie es in ',
        		'login_too_many_attempts_2': ' Minuten erneut.'
            },
        	'ja_JP' : {
        		"reset": "リセット",
        		"please_enter_your": "入力してください",
        		"please_enter_your_email": "電子メールアドレスを入力してください",
        		"creating_account": "アカウント作成中...",
        		"create_account_btn": "アカウント作成",
        		"loggin_in": "ログインします...",
        		"login": "ログイン",
        		"email_dont_exist": "この電子メールは存在しません",
        		"username_dont_exist": "このユーザー名は存在しません",
        		"valid_email": "有効な電子メールアドレスを入力してください",
        		"check_credentials": "あなたのユーザー名とパスワードを使用してください",
        		"you_must_agree": "プライバシーポリシーと利用規約に同意してください",
        		"first_name": "名前",
        		"last_name": "名字",
        		"max30": "#[field]が長すぎます（最大30文字）",
        		"noURL": "#[field]にURLを含んではいけません",
        		"noSymbols": "#[field]に含んではいけない記号：&/:$%<>",
        		"email_used": "この電子メールは既に使用されています",
        		"username_taken": "このユーザー名は既に使用されています",
        		"enter_username": "ユーザー名を入力してください",
        		"enter_valid_username": "有効なユーザー名を入力してください（最低4文字：a～z、A～Z、0～9）",
        		"username_too_long": "ユーザー名が長すぎます（最大240文字）",
        		"short_password": "パスワードが短すぎます（最小6文字）",
        		"no_match": "パスワードが一致しません",
        		"enter_password": "パスワードを入力してください",
        		"unexpected_error": "申し訳ありません。予期せぬエラーが発生しました。もう一度やり直してください。",
        		"invalid_token": "無効な認証トークンです。",
        		"processing": "処理中です...",
        		"user_not_found": "ユーザーが見つかりません",
        		'login_error_max_rate_1': '許可されているリクエストレートは最大',
        		'login_error_max_rate_2': 'です。後でもう一度やり直してください。',
        		'login_too_many_attempts_1': 'ログイン試行が多すぎます。 パスワードをリセットするか、',
        		'login_too_many_attempts_2': '分後に再試行してください。'
        	},
        	'fr_FR' : {
        		"reset": "Réinitialiser",
        		"please_enter_your": "Veuillez saisir votre",
        		"please_enter_your_email": "Veuillez saisir votre adresse e-mail.",
        		"creating_account": "Création du compte…",
        		"create_account_btn": "Créer mon compte",
        		"loggin_in": "Connexion…",
        		"login": "Se connecter",
        		"email_dont_exist": "Cette adresse e-mail n'existe pas.",
        		"username_dont_exist": "Ce nom d'utilisateur n'existe pas.",
        		"valid_email": "Veuillez saisir une adresse e-mail valide.",
        		"check_credentials": "Veuillez utiliser vos nom d'utilisateur et mot de passe.",
        		"you_must_agree": "Veuillez accepter la Politique de confidentialité et les Conditions d'utilisation.",
        		"first_name": "Prénom",
        		"last_name": "Nom",
        		"max30": "Votre #[field] est trop long (maximum 30 caractères).",
        		"noURL": "Votre #[field] ne peut pas contenir d'URL.",
        		"noSymbols": "Votre #[field] ne peut pas contenir ces symboles : &/:$%<>",
        		"email_used": "Cette adresse e-mail est déjà utilisée.",
        		"username_taken": "Ce nom d'utilisateur est déjà pris.",
        		"enter_username": "Veuillez saisir un nom d'utilisateur.",
        		"enter_valid_username": "Veuillez saisir un nom d'utilisateur valide (minimum 4 caractères, a-z A-Z 0-9).",
        		"username_too_long": "Votre nom d'utilisateur est trop long (maximum 240 caractères).",
        		"short_password": "Votre mot de passe est trop court (minimum 6 caractères).",
        		"no_match": "Les mots de passe ne correspondent pas.",
        		"enter_password": "Veuillez saisir un mot de passe.",
        		"unexpected_error": "Désolé, une erreur inattendue est survenue. Veuillez réessayer.",
        		"invalid_token": "Code de vérification invalide",
        		"processing": "Traitement…",
        		"user_not_found": "Utilisateur introuvable",
        		'login_error_max_rate_1': 'Vous avez droit à un maximum',
        		'login_error_max_rate_2': 'taux de demande, veuillez réessayer plus tard.',
        		'login_too_many_attempts_1': 'Trop de tentatives de connexion. Veuillez réinitialiser le mot de passe ou réessayer dans ',
        		'login_too_many_attempts_2': 'minutes.'
        	},
        };
        
        (function() {
          var EMAIL_REGEXP, SYMBOL_REGEXP, UAstring, URL_REGEXP, browser, browserVer, browsers, data, index, rv, _i, _len;
          EMAIL_REGEXP = /^[_a-z0-9-]+([\.\+][_a-z0-9-]+)*@(?!myemokili\.com$)([a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,})$)/i;
          URL_REGEXP = /([a-zA-Z\d]+:\/\/)?((\w+:\w+@)?([a-zA-Z\d.-]+\.[A-Za-z]{2,4})(:\d+)?(\/.*)?)/i;
          SYMBOL_REGEXP = /[&/:$%<>]/;
          browsers = [
            {
              key: 'Edge',
              identity: 'MS Edge'
            }, {
              key: 'Chrome',
              identity: 'Chrome'
            }, {
              key: 'MSIE',
              identity: 'Explorer'
            }, {
              key: 'Trident',
              identity: 'Explorer'
            }, {
              key: 'Firefox',
              identity: 'Firefox'
            }, {
              key: 'Safari',
              identity: 'Safari'
            }, {
              key: 'Opera',
              identity: 'Opera'
            }
          ];
          browser = 'Other';
          browserVer = 'Unknown';
          UAstring = navigator.userAgent;
          for (_i = 0, _len = browsers.length; _i < _len; _i++) {
            data = browsers[_i];
            index = UAstring.indexOf(data.key);
            if (index !== -1) {
              browser = data.identity;
              rv = UAstring.indexOf('rv:');
              if (data.key === 'Trident' && rv !== -1) {
                browserVer = parseFloat(UAstring.substring(rv + 3));
              } else {
                browserVer = parseFloat(UAstring.substring(index + data.key.length + 1));
              }
              break;
            }
          }
          return NIXValidator = {
            name: function(name, text) {
              if (text == null) {
                text = 'name';
              }
              return Q.fcall(function() {
                name = $.trim(name);
                var error;
                if (name.length === 0) {
                  throw  USER_LANGUAGE[language]['please_enter_your'] + text;
                }
                if (name.length > 30) {
                  error = USER_LANGUAGE[language]['max30'].replace('#[field]', text.toLowerCase())
                  throw error;
                }
                if (URL_REGEXP.test(name)) {
                  error = USER_LANGUAGE[language]['noURL'].replace('#[field]', text.toLowerCase())
                  throw error;
                }
                if (SYMBOL_REGEXP.test(name)) {
                  error = USER_LANGUAGE[language]['noSymbols'].replace('#[field]', text.toLowerCase())
                  throw error;
                }
              });
            },
            email: function(email) {
              return Q.fcall(function() {
                var deferred;
                email = $.trim(email);
                if (email.length === 0) {
                  throw USER_LANGUAGE[language]['please_enter_your_email'];
                }
                if (!EMAIL_REGEXP.test(email)) {
                  throw USER_LANGUAGE[language]['valid_email'];
                }
                deferred = Q.defer();
                $.ajax({
                  url: "" + apiUrl + "/user/exists/json/",
                  type: 'POST',
                  dataType: 'json',
                  data: {
                    email: email,
                    username: 'emokili@' + usernameDomainPart
                  },
                  success: function(data) {
                    if (data.email) {
                      return deferred.resolve();
                    }
                    return deferred.reject(USER_LANGUAGE[language]['email_dont_exist']);
                  },
                  error: function(request) {
                    return deferred.reject(new Error(request.responseText));
                  }
                });
                return deferred.promise;
              });
            },
            username: function(username) {
              return Q.fcall(function() {
                var deferred, notusername;
                username = $.trim(username);
                if (username.length === 0) {
                  throw  USER_LANGUAGE[language]['enter_username'];
                }
                notusername = new RegExp('[^-_.A-Za-z0-9]');
                if ((username.length < 4) || (username.match(notusername))) {
                  throw USER_LANGUAGE[language]['enter_valid_username'];
                }
                if (("" + username + "@myemokili.com").length > 255) {
                  throw USER_LANGUAGE[language]['username_too_long'];
                }
                deferred = Q.defer();
                $.ajax({
                  url: "" + apiUrl + "/user/exists/json/",
                  type: 'POST',
                  dataType: 'json',
                  data: {
                    username: username + '@' + usernameDomainPart,
                    email: 'email@email.com'
                  },
                  success: function(data) {
                    if (data.username) {
                      return deferred.resolve();
                    }
                    return deferred.reject(USER_LANGUAGE[language]['username_dont_exist']);
                  },
                  error: function(request) {
                    return deferred.reject(new Error(request.responseText));
                  }
                });
                return deferred.promise;
              });
            },
            password: function(password) {
              return Q.fcall(function() {
                if (password.length === 0) {
                  throw USER_LANGUAGE[language]['enter_password'];
                }
                if (password.length < 6) {
                  throw USER_LANGUAGE[language]['short_password'];
                }
              });
            },
            password2: function(password, password2) {
              return this.password(password).then(function() {
                if (password !== password2) {
                  throw USER_LANGUAGE[language]['no_match'];
                }
              }, function() {});
            },
            browser: {
              name: browser,
              version: browserVer,
              supported: !(browser === 'Explorer' && browserVer < 10.0)
            },
            old: {
              isValidSerialNumber: function(param) {
                var notnumber;
                notnumber = new RegExp('[^0-9]');
                if ((param.length < 16) || (param.match(notnumber))) {
                  return false;
                }
                return true;
              },
              isValidName: function(param) {
                if (param.length === 0 || param.length > 30) {
                  return false;
                }
                if (URL_REGEXP.test(name)) {
                  return false;
                }
                if (SYMBOL_REGEXP.test(name)) {
                  return false;
                }
                return true;
              },
              isValidEmail: function(param) {
                if (EMAIL_REGEXP.test(param)) {
                  return true;
                }
                return false;
              },
              isValidNixEmail: function(param) {
                var notnixemail;
                notnixemail = new RegExp('[^-_.A-Za-z0-9]');
                if ((param.length < 4) || (param.match(notnixemail))) {
                  return false;
                }
                return true;
              },
              isTooShortNixEmail: function(param) {
                if (param.length < 4) {
                  return true;
                }
                return false;
              },
              isMatchPassword: function(password1, password2) {
                if (password1 !== password2) {
                  return false;
                }
                return true;
              }
            }
          };
        })();
        </script>
        <script>
            $(document).ready(function() {
            var forgetForm = $('#forget-form');
            var forgetSubmit = $('#forget-form .submit');
            var errorContainer = $('.login-error-container');
            forgetSubmit.click(function() {
                $('#forget-form ul.error').remove();
                $('.email-group').removeClass('error');


                var email = $('#forget-form #email').val() || ' ';

                if ( !NIXValidator.old.isValidEmail(email) ) {
                    errorContainer.html('<ul class="error"><li>'+ USER_LANGUAGE[language]['valid_email'] +'</li></ul>');
                     $('.email-group').addClass('error');
                    return false;
                }

				if (getToken){
					getToken();
				}

                forgetSubmit.text(USER_LANGUAGE[language]['processing']);
                forgetSubmit.attr('disabled','disabled');
				getToken().then(function(t){
					$.ajax({
						url: apiV3Url+'/password/retrieval/',
						dataType: 'json',
						data: {
							email: email,
							token: t,
							captcha: document.getElementById('g-recaptcha') ? grecaptcha.getResponse() : '',
						},
						type: "POST",
						success: function(data) {
							$("#request-reset").hide();
							$("#request-sent").show();
							},
						error:function (request, status, error)
						{
							try {
								grecaptcha.reset()
							} catch (e) {}
							var error = USER_LANGUAGE[language]['unexpected_error'];
							if (request.status != 500) {
								resp = $.parseJSON(request.responseText);
								error = resp.error.message;
							}

							if (error.indexOf('User not found') > -1) {
								error = USER_LANGUAGE[language]['user_not_found'];
							}

							errorContainer.html('<ul class="error"><li>'+ error +'</li></ul>');
							$('.email-group').addClass('error');
							forgetSubmit.text(USER_LANGUAGE[language]['reset']);
							forgetSubmit.removeAttr('disabled');
						}
					});
				})
                return false;
            });

        });

        </script>
<script type="text/javascript"> var utag_data = {}; </script>
<script type="text/javascript">
    var env = 'prod';
    if (env !== 'prod' && env !== 'qa') {
        env = 'dev';
    }
    (function (a, b, c, d) {
        window.utag_cfg_ovrd = {noview : true};
        a = './main/' + env + '/utag.js';
        b = document;
        c = 'script';
        d = b.createElement(c);
        d.src = a;
        d.type = 'text/java' + c;
        d.async = true;
        a = b.getElementsByTagName(c)[0];
        a.parentNode.insertBefore(d, a);
    })();
</script>
</body>
</html>

